import axios from "axios";
axios.defaults.baseURL = "/api"

//1. 查询所有规格列表
export function findAll() {
    return axios.get("/specification/list.do")
}

//2. 分页查询规格列表
export function findByPage(page,pageSize) {
    return axios.get(`/specification/findByPage.do?page=${page}&pageSize=${pageSize}`)
}

//3. 分页带条件查询
export function search(page,pageSize,specSearch) {
    return axios.post(`/specification/search.do?page=${page}&pageSize=${pageSize}`,specSearch)
}

//4. 分页带条件查询
export function findById(id) {
    return axios.get(`/specification/findById.do?id=${id}`)
}

//5. 保存规格
export function save(url,data) {
    return axios.post(url,data)
}

//6. 根据id来删除规格
export function delSpec(ids) {
    return axios.get(`/specification/delete.do?ids=${ids}`)
}